package com.woniuxy.producer;

import com.woniuxy.util.RabbitmqConst;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author dingpf
 * @version 1.0
 * @description
 * @create 2025/5/6 15:58
 */
@Component
public class TopicProducer {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send(String routekey,String msg){
        rabbitTemplate.convertAndSend(RabbitmqConst.TOPIC_EXCHANGE,routekey,msg);
    }
}
